﻿using System.Collections.Generic;
using Bussiness.Model;
using NHibernate;

namespace Bussiness.Service.Base
{
    public interface IDAO<T, TId>
    {
        T FindById(TId id);
        T FetchById(TId id);
        IList<T> FindAll();
        IList<T> FindByExample(T exampleInstance, params string[] excludeProperties);
        T MakePersistance(T entity);
        void MakeTransient(T entity);
        void Flush();
        void Clear();
        IList<T> FindByCriteria(ICriteria criteria, int start, int range);
        int CountByCriteria(ICriteria criteria);
    }
}